s1 = '  Hallo World  '
print(s1.title()) # Hallo World
print(s1.upper()) # HALLO WORLD
print(s1.lower()) # hallo world
print(s1.rstrip())
print(s1.lstrip())
print(s1.strip())
print(s1.find('l'))
print(s1.index('l'))
print(s1.count('World'))
print(s1.replace('o','0'))
print(s1.split())
print(s1.split('W'))
print(s1.startswith('hallo'))
print(s1.startswith('  Hallo'))
print(s1.endswith('World  '))
print(s1.endswith('world'))
print(s1.isdigit())
print(s1.isalnum())
print('|'.join(s1))

print('----------------------------------')


A='dguagaauuusaa'
print(A.find('a'))
print(A.find('a',3))
print(A.find('a',5,10))
print(A.find('a',0,2))


print(A.index('a'))
print(A.index('a',1,7))
print(A.index('a',0,4))


print(A.count('a'))
print(A.replace('a','A'))

print(A.replace("a","A",3))

print('----------------------------------')

s1='1 5 67 8959554'
print(s1.split())

print(s1.split('5'))

r=s1.split('5')
print(r)
#以sep来分割字符串，并返回列表，分割默认空格

print('----------------------------------')

s2='asdfg12345'
print(s2.startswith('a')) #True
print(s2.startswith('b')) #False
print(s2.startswith('f',3))#True

print(s2.endswith('b')) #False
print(s2.endswith('5')) #True
print(s2.endswith('2',0,7)) #True


print('----------------------------------')
s3='qwertyuio'
print(s3.isalpha())#True
s4='qwert123456'
print(s3.isalpha())#False

s5='12345678'
print(s5.isdigit())#True
s6='qwerty54321'
print(s6.isdigit())#False

s7='qwerty1234567'
print(s7.isalnum())#True
s8="qwert@12345"
print(s8.isalnum())#False

s9='qwert123456'
print('--'.join(s9))#q--w--e--r--t--1--2--3--4--5--6


result1 =bin(8)
print(result1)

result2 = oct(1024)
print(result2)

result3 =hex(2575)
print(result3)